<%--
  Created by IntelliJ IDEA.
  User: 叶叶
  Date: 2022/1/15
  Time: 11:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>物料设计单</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://unpkg.com/bootstrap-table@1.15.3/dist/bootstrap-table.min.css">
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
    <script src="https://unpkg.com/bootstrap-table@1.15.3/dist/bootstrap-table.min.js"></script>
    <script src="../js/bootstrap-table-zh-CN.min.js"></script>
</head>
<body>
<div class="container" id="div1">
    <span style="color: blue;font-family: 华文宋体"><marquee width=400 direction=left align=middle><span>您正在做的业务是：生产管理--工序物料设计--制定工序物料设计单</span></marquee></span>
    <!--      <div class="row" style="margin-top: 20px">-->
    <!--          <div class="col-10">-->
    <!--          </div>-->
    <!--          <div class="col-2">-->
    <!--              <button class="btn btn-primary" data-toggle="modal" data-target="#myModal" onclick="add1()">添加</button>-->
    <!--          </div>-->
    <!--      </div>-->
    <div class="container">
        <div class="row">
            <caption>
                <div style="float: right;margin-bottom: 5px">
                </div>
            </caption>
            <table id="table" class="table table-hover table-bordered" style="width: 1100px">
                <thead>
                <tr align="center">
                    <th>工序设计单编号</th>
                    <th>产品编号</th>
                    <th>产品名称</th>
                    <th>设计人</th>
                    <th>登记时间</th>
                    <th>工时总成本</th>
                    <th>制定</th>
                </tr>
                </thead>
                <tbody>

            </table>
        </div>
    </div>
</div>
</div>
<DIV class=DIV_STYLE2 style="display: none" id="div2"><TABLE cellSpacing=0 cellPadding=0 width=1000 align=center bgColor=#ffffff border=0 >
    <div style="position: relative;left: 60%">
        <input  onclick="tijiao11()" class="btn3_mouseout" type=button value=提交>
        <input  onclick="fanhui()" class="btn3_mouseout" type=button value=返回 id="fh">
    </div>
    <TBODY>
    <TR>
        <TD class=TABLE_STYLE6 vAlign=bottom rowSpan=2 align=center>
            <TABLE style="BORDER-TOP: #333333 1px solid; BORDER-RIGHT: #333333 1px solid; BORDER-BOTTOM: #333333 1px solid; BORDER-LEFT: #333333 1px solid" cellSpacing=0 cellPadding=0 width="100%" border=0>
                <TBODY>
                <TR>
                    <TD height=10 colSpan=4>
                        <TABLE width="100%">
                            <TBODY>
                            <TR>
                                <TD>
                                    <table align="center">
                                        <tr>
                                            <td><h3>工序物料设计单</h3></td>
                                        </tr>
                                    </table>
                                    <br>
                                    <div>
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        <span>工序单编号:</span>
                                        <span id="sjbh"></span>
                                        <span style="position: absolute;left:800px;">设计人:<span id="sjr"></span></span>
                                        <br>
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        <span>产品名称:<span id="cpmc"></span></span>
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        <span style="position: absolute;left: 800px">产品编号:<span id="cpbh" ></span></span>
                                    </div>
                                    <br>
                                    <TABLE id=tableOnlineEdit class=TABLE_STYLE5 borderColor=#000000  cellSpacing=0 cols=1 borderColorDark=#eeeeee cellPadding=0 align=center borderColorLight=#848284 border=1><THEAD>
                                    <TR class=TR_STYLE2 height="10" bgColor=#d2e9ff>
                                        <TD class=TD_STYLE2 borderColor=#dedbd6  align=left>编号</TD>
                                        <TD class=TD_STYLE2 borderColor=#dedbd6 align=left>工序名称</TD>
                                        <TD class=TD_STYLE2 borderColor=#dedbd6  align=left>工序编号</TD>
                                        <TD class=TD_STYLE2 borderColor=#dedbd6  align=left>描述</TD>
                                        <TD class=TD_STYLE2 borderColor=#dedbd6  align=left>工时数</TD>
                                        <TD class=TD_STYLE2 borderColor=#dedbd6  align=left>工时单位</TD>
                                        <TD class=TD_STYLE2 borderColor=#dedbd6  align=left>单位工时成本</TD>
                                        <TD class=TD_STYLE2 borderColor=#dedbd6  align=left>工时成本小计(元)</TD>
                                        <TD class=TD_STYLE2 borderColor=#dedbd6  align=left>物料成本小计</TD>
                                        <TD class=TD_STYLE2 borderColor=#dedbd6  align=left>设计</TD></TR>
                                    <%--                                    <TR class=TR_STYLE1  height=20>--%>
                                    <%--                                        <TD class=TD_STYLE2 borderColor=#dedbd6 align=left><INPUT id=checkLine class=CHECKBOX_STYLE1 type=checkbox value=on name=checkbox></TD>--%>
                                    <%--                                        <TD class=TD_STYLE2 borderColor=#dedbd6 align=left><INPUT onfocus=this.blur() class=INPUT_STYLE4 name=procedure_name>fds</TD>--%>
                                    <%--                                        <TD class=TD_STYLE2 borderColor=#dedbd6 align=left><INPUT onfocus=this.blur() class=INPUT_STYLE4 name=procedure_ID>fds</TD>--%>
                                    <%--                                        <TD class=TD_STYLE2 borderColor=#dedbd6 align=left><SPAN style="WIDTH: 120px; BACKGROUND: #ffffff" name="product_describe_ok"></SPAN><INPUT onfocus=this.blur() class=INPUT_STYLE4 type=hidden name=procedure_describe></TD>--%>
                                    <%--                                        <TD class=TD_STYLE2 borderColor=#dedbd6 align=left><INPUT class=INPUT_STYLE5 name=labour_hour_amount></TD>--%>
                                    <%--                                        <TD class=TD_STYLE2 borderColor=#dedbd6 align=left><INPUT class=INPUT_STYLE5 name=amount_unit></TD>--%>
                                    <%--                                        <TD class=TD_STYLE2 borderColor=#dedbd6 align=left><INPUT class=INPUT_STYLE5 name=cost_price></TD>--%>
                                    <%--                                        <TD class=TD_STYLE2 borderColor=#dedbd6 align=left>&nbsp;</TD></TR>
                                                --%>
                                    </THEAD>
                                    </TABLE>
                                    <br>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <span>工时总成本:<span id="zcb"></span></span>
                                    <span style="margin-left: 500px">物料总成本:<span id="wcb"></span></span>
                                    <div>
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        <span>审核人:<span id="djr"></span></span>
                                        &nbsp;&nbsp;&nbsp;&nbsp;
                                        <span style="position: relative;left:200px;">审核时间:<span id="shijian"></span></span>
                                    </div>
                                    <br>

                                    <div>
                                        <div>
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <span style="position: relative;top: -40px">设计要求:</span><textarea style="resize: none" rows=4 cols="100" id="sjyq"></textarea>
                                        </div>
                                    </div>
                                </TD></TR></TBODY></TABLE></TD></TR>
                <TR>
                    <TD width=56 colSpan=3 noWrap></TD></TR>
                <TR>
                    <TD height=100 colSpan=3 noWrap></TD>
                    <TD></TD></TR>
                <TR vAlign=bottom>
                    <TD colSpan=4 noWrap align=center></TD></TR></TD>
                <TR>
                    <TD colSpan=4 noWrap align=right></TD></TR></TBODY></TABLE></TD>
        <TD bgColor=#ffffff height=2 width=1></TD>
        <TD bgColor=#ffffff height=2 width=1></TD>
        <TD bgColor=#ffffff height=2 width=1></TD></TR>
    <TR>
        <TD bgColor=#333333 height=120 width=1></TD>
        <TD bgColor=#666666 height=120 width=1></TD>
        <TD bgColor=#999999 height=120 width=1></TD></TR>
    <TR align=right vAlign=top>
        <TD colSpan=4>
            <TABLE class=TABLE_STYLE6 cellSpacing=0 cellPadding=0 align=center border=0>
                <TBODY>
                <TR>
                    <TD bgColor=#333333 height=1></TD></TR>
                <TR>
                    <TD bgColor=#666666 height=1></TD></TR>
                <TR>
                    <TD bgColor=#999999 height=1></TD></TR></TBODY></TABLE></TD></TR>
    <TR align=right vAlign=middle>
        <TD colSpan=4></TD></TR></TBODY></TABLE></DIV>

<DIV class=DIV_STYLE2 style="display: none" id="div3"><TABLE cellSpacing=0 cellPadding=0 width=350 align=center bgColor=#ffffff border=0>
    <span style="color: blue;font-family: 华文宋体"><marquee width=400 direction=left align=middle><span>您正在做的业务是：生产管理--工序物料设计--制定工序物料设计单</span></marquee></span>

    <TBODY>
    <div style="position: relative;left: 60%">
        <input  onclick="tijiao1()" class="btn3_mouseout" type=button value=预览>
        <input  onclick="tuichu()" class="btn3_mouseout" type=button value=返回>
    </div>
    <TR>
        <TD class=TABLE_STYLE6 vAlign=bottom rowSpan=2 align=center>
            <TABLE style="BORDER-TOP: #333333 1px solid; BORDER-RIGHT: #333333 1px solid; BORDER-BOTTOM: #333333 1px solid; BORDER-LEFT: #333333 1px solid" cellSpacing=0 cellPadding=0 width="1000px" border=0>
                <TBODY>
                <TR>
                    <TD height=10 colSpan=4>
                        <TABLE width="100%">
                            <TBODY>
                            <TR>
                                <TD>
                                    <TABLE class=TABLE_STYLE4 align=center>
                                        <TBODY>
                                        <TR class=TR_STYLE1 height=20>
                                            <TD class=TD_STYLE5 height=5 align=center>&nbsp;</TD></TR></TBODY></TABLE>
                                    <TABLE class=TABLE_STYLE4 align=center>
                                        <TBODY>
                                        <TR class=TR_STYLE1 height=20>
                                            <TD class=TD_STYLE5 height=5 align=center><FONT size=4><B>工序物料设计单</B></FONT></TD></TR></TBODY></TABLE>
                                    <TABLE class=TABLE_STYLE4 align=center>
                                        <TBODY>
                                        <TR class=TR_STYLE1 height=20>
                                            <TD class=TD_STYLE5 height=5 align=center>&nbsp;</TD></TR></TBODY></TABLE>
                                    <TABLE class=TABLE_STYLE4 align=center>
                                        <TBODY>
                                        <TR class=TR_STYLE1 height=20>
                                            <TD class=TD_STYLE3><INPUT type=hidden value=官方 name=product_name1>制造:<span id="cp"></span>产品，供选择的物料清单如下：&nbsp;</TD></TR></TBODY></TABLE><INPUT type=hidden value=包装 name=procedure_name> <INPUT type=hidden value=03020020220113100002 name=design_ID> <INPUT type=hidden value=02040020220116100002 name=module_design_ID>
                                    <TABLE id="table1" class=TABLE_STYLE5 borderColor=#000000 cellSpacing=0 borderColorDark=#eeeeee cellPadding=0 align=center borderColorLight=#848284 border=1>
                                        <TBODY>
                                        <TR class=TR_STYLE2 height=20 bgColor=#d2e9ff>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 align=left><FONT onmouseup=MouseUpToResize(this); onmousemove=MouseMoveToResize(this); onmousedown=MouseDownToResize(this); class=resizeDivClass style="LEFT: 40px"></FONT>序号</TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 align=left><FONT onmouseup=MouseUpToResize(this); onmousemove=MouseMoveToResize(this); onmousedown=MouseDownToResize(this); class=resizeDivClass style="LEFT: 79px"></FONT>物料名称 </TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 align=left><FONT onmouseup=MouseUpToResize(this); onmousemove=MouseMoveToResize(this); onmousedown=MouseDownToResize(this); class=resizeDivClass style="LEFT: 191px"></FONT>物料编号 </TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 align=left><FONT onmouseup=MouseUpToResize(this); onmousemove=MouseMoveToResize(this); onmousedown=MouseDownToResize(this); class=resizeDivClass style="LEFT: 61px"></FONT>描述</TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 align=left><FONT onmouseup=MouseUpToResize(this); onmousemove=MouseMoveToResize(this); onmousedown=MouseDownToResize(this); class=resizeDivClass style="LEFT: 78px"></FONT>设计数量 </TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 align=left><FONT onmouseup=MouseUpToResize(this); onmousemove=MouseMoveToResize(this); onmousedown=MouseDownToResize(this); class=resizeDivClass style="LEFT: 78px"></FONT>可用数量</TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 align=left><FONT onmouseup=MouseUpToResize(this); onmousemove=MouseMoveToResize(this); onmousedown=MouseDownToResize(this); class=resizeDivClass style="LEFT: 41px"></FONT>单位 </TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 align=left><FONT onmouseup=MouseUpToResize(this); onmousemove=MouseMoveToResize(this); onmousedown=MouseDownToResize(this); class=resizeDivClass style="LEFT: 96px"></FONT>单价（元）</TD>
                                            <TD class=TD_STYLE2 borderColor=#dedbd6 align=left><FONT onmouseup=MouseUpToResize(this); onmousemove=MouseMoveToResize(this); onmousedown=MouseDownToResize(this); class=resizeDivClass style="LEFT: 96px"></FONT>本工序数量</TD></TR>
                                        </TBODY></TABLE>
                                    <TABLE class=TABLE_STYLE4 align=center>
                                        <TBODY>
                                        <TR class=TR_STYLE1 height=20>
                                            <TD class=TD_STYLE5 height=5 align=center>&nbsp;</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
                <TR>
                    <TD width=56 colSpan=3 noWrap></TD></TD></TR>
                <TR>
                    <TD height=100 colSpan=3 noWrap></TD>
                    <TD></TD></TR>
                <TR vAlign=bottom>
                    <TD colSpan=4 noWrap align=center></TD></TR></TD>
                <TR>
                    <TD colSpan=4 noWrap align=right></TD></TR></TBODY></TABLE></TD>
        <TD bgColor=#ffffff height=2 width=1></TD>
        <TD bgColor=#ffffff height=2 width=1></TD>
        <TD bgColor=#ffffff height=2 width=1></TD></TR>
    <TR>
        <TD bgColor=#333333 height=120 width=1></TD>
        <TD bgColor=#666666 height=120 width=1></TD>
        <TD bgColor=#999999 height=120 width=1></TD></TR>
    <TR align=right vAlign=top>
        <TD colSpan=4>
            <TABLE class=TABLE_STYLE6 cellSpacing=0 cellPadding=0 align=center border=0>
                <TBODY>
                <TR>
                    <TD bgColor=#333333 height=1></TD></TR>
                <TR>
                    <TD bgColor=#666666 height=1></TD></TR>
                <TR>
                    <TD bgColor=#999999 height=1></TD></TR></TBODY></TABLE></TD></TR>
    <TR align=right vAlign=middle>
        <TD colSpan=4></TD></TR></TBODY></TABLE></DIV>
<script>
    //工序物料设计
    $(function () {
        $("#table").bootstrapTable({
            method:"post",
            contentType:"application/json",
            url:"/cha/wl",
            //初始页数
            pageNumber:1,
            pagination: true,
            sidePagination:"server",
            pageSize:2,
            pageList:[2,4,6,8,10],
            queryParams:function (param) {
                return {
                    page: (param.offset / param.limit) + 1,
                    pageNum: param.limit,
                }
            },
            columns:[
                {title:"工序设计单编号",field:"designId",align:"center"},
                {title:"产品编号",field:"productId",align:"center"},
                {title:"产品名称",field:"productName",align:"center"},
                {title:"设计人",field:"designer",align:"center"},
                {title:"登记时间",field:"registerTime",align:"center"},
                {title:"工时总成本",field:"costPriceSum",align:"center"},
                {title:"制定",field:"",align:"center", formatter:function (value, row, index) {
                        var btn2 = "<button class='btn btn-info'  onclick='cha(" + row.designId + ")'>制定</button>";
                        return btn2;
                    }}
        ]
        })
        $("#fh").click(function () {
            $("#table").bootstrapTable("refresh");
        })
    })
    function cha(designId) {
            document.getElementById("div1").style.display='none'
            document.getElementById("div2").style.display='block'
            $.ajax({
                type:"post",
                url: "/cha/wg/"+designId,
                dataType:"json",
                success:function (data) {
                    var sj = ""
                    for (var i=0;data.length;i++) {
                        document.getElementById("sjyq").innerText = data[i].procedureDescribe
                        document.getElementById("zcb").innerText = data[i].costPriceSum
                        document.getElementById("sjbh").innerText = data[i].designId
                        document.getElementById("cpmc").innerText = data[i].productName
                        document.getElementById("cpbh").innerText = data[i].productId
                        document.getElementById("djr").innerText = data[i].designer
                        document.getElementById("sjr").innerText=data[i].register
                        document.getElementById("shijian").innerText=data[i].registerTime
                        document.getElementById("wcb").innerText=data[i].moduleCostPriceSum
                        var xx = data[i].mDesignProcedureDetailsList;
                        for (var i=0;xx.length;i++) {

                            if(xx[i].designModuleTag1=="D002-0"){
                                sj="设计"
                            }else {
                                sj="重新设计"
                            }
                             document.getElementById("tableOnlineEdit").innerHTML +=
                                 "<tr>" +
                                 "<td><span id='bh1'>" + xx[i].mid + "</span></td>" +
                                 "<td>" + xx[i].procedureName + "</td>" +
                                 "<td>" + xx[i].procedureId + "</td>" +
                                 "<td></td>" +
                                 "<td>" + xx[i].labourHourAmount + "</td>" +
                                 "<td>" + xx[i].amountUnit + "</td>" +
                                 "<td>" + xx[i].costPrice + "</td>" +
                                 "<td>" + xx[i].subtotal + "</td>" +
                                 "<td><span class='jj'>"+xx[i].moduleSubtotal1+"</span></td>" +
                                 "<td><a href='#' onclick='sj("+xx[i].mid+","+xx[i].procedureId+")'><span id='sj'>"+sj+"</span></a></td>" +
                                "</tr>"
                        }
                    }
                },error:function (data) {
                    console.log("Xxx")
                }
            })

        }
        function fanhui() {
           document.location='mdesign.jsp'
        }
    function sj(id,procedureId1) {
        $("#table").bootstrapTable("refresh")
        document.getElementById("div3").style.display='block'
        document.getElementById("div2").style.display='none'
        document.getElementById("div1").style.display='none'
        let productId = document.getElementById("cpbh").innerText;
        $.ajax({
            type: "get",
            url:"/cha/sj1/"+productId,
            dataType: "json",
            success:function (data) {
                document.getElementById("table1").innerHTML+=
                    "<input type='hidden' id='id' value='"+id+"'>"
                for (var i=0;i<data.length;i++){
                    document.getElementById("cp").innerText=data[i].productName;
                    let dModuleDetails = data[i].dModuleDetails;
                    for (var j=0;j<dModuleDetails.length;j++) {
                        document.getElementById("table1").innerHTML +=
                            "<tr>" +
                            "<input type='hidden' id='procedureId' value='"+procedureId1+"'>"+
                            "<input type='hidden' class='mid'  value='"+dModuleDetails[j].mid+"'>"+
                            "<td>"+dModuleDetails[j].detailsInt+"</td>" +
                            "<td>"+dModuleDetails[j].productName1+"</td>" +
                            "<td>"+dModuleDetails[j].productId1+"</td>" +
                            "<td><input class='ccc' type='hidden' value=''></td>" +
                            "<td>"+dModuleDetails[j].amount+"</td>" +
                            "<td><span class='ky'>"+dModuleDetails[j].residualAmount+"</span></td>" +
                            "<td>"+dModuleDetails[j].amountUnit+"</td>" +
                            "<td><span class='qq'>"+dModuleDetails[j].costPrice+"</span></td>" +
                            "<td><input type='text' class='bg' style='background: lightgoldenrodyellow;border: 1px'></td>" +
                            "</tr>"
                    }
                }
            }
        })
    }
    function tijiao1() {
        let nodeListOf = document.getElementById("table1").querySelectorAll("tr");
        let val = document.getElementsByClassName("ccc");
        for (var i=0;i<nodeListOf.length-1;i++){
            var nodeListOf1= nodeListOf[i+1].querySelectorAll("td");
            var a= nodeListOf1[nodeListOf.length+5].querySelectorAll("input")[0].value;
            var b= nodeListOf1[nodeListOf.length+4].innerText;
            var number1 = a*b;
            nodeListOf1[nodeListOf.length].querySelectorAll("input")[0].value=number1;
        }
        let war=0;
        for (var j=0;j<val.length;j++){
            war+=parseInt(val[j].value);
        }
        document.getElementsByClassName("jj").innerText=war;
        let module_subtotal1 = document.getElementsByClassName("jj").innerText;
        let mid11 = document.getElementById("id").value;
        var xx1={
            mid:mid11,
            moduleSubtotal1:module_subtotal1
        }
        $.ajax({
            type:"post",
            url:"/cha/xg/",
            dataType:"json",
            contentType: "application/json",
            data:JSON.stringify(xx1),
            success:function (data) {
                    console.log("小计")
            }
        })
        let mid = document.getElementsByClassName("mid");
        let residualAmount = document.getElementsByClassName("bg");
        let residualAmount1 = document.getElementsByClassName("ky");
        for (var z=0;z<mid.length;z++){
            for (var i=z;i<residualAmount.length;i++) {
                for (var j = i; j < residualAmount1.length; j++) {
                    var number = residualAmount1[j].innerText - residualAmount[i].value;
                    let mid1 = mid[z].value;
                var xx = {
                    mid: mid1,
                    residualAmount: number

                }
                $.ajax({
                    type: "post",
                    url: "/cha/ky/",
                    dataType: "json",
                    contentType: "application/json",
                    data: JSON.stringify(xx),
                    success: function (data) {

                    }, error: function (data) {
                        console.log("xxx")
                    }
                })
            }
        }
        }
        let mid1 = document.getElementById("id").value;
        console.log(mid1)
        $.ajax({
            type:"post",
            url:"/cha/zt/"+mid1,
            dataType:"json",
            success:function (data) {
                console.log("zzz")
            }
        })
        //父级序号
        let procedureId = document.getElementById("procedureId").value;
        console.log(procedureId)
        let nodeListOf11 = document.getElementById("table1").querySelectorAll("tr");
        for (var i = 0; i < nodeListOf11.length - 1; i++) {
            var nodeListOf111 = nodeListOf11[i + 1].querySelectorAll("td");
            console.log(nodeListOf111)
            //小计
            let subtotal = nodeListOf111[nodeListOf11.length].querySelectorAll("input")[0].value;
            //本工序数量
            let amount = nodeListOf111[nodeListOf11.length + 1].innerText;
            //可用数量
            let innerText3 = nodeListOf111[nodeListOf11.length + 2].innerText;
            //单位
            let amountUnit = nodeListOf111[nodeListOf11.length + 3].innerText;
            //单价
            let costPrice = nodeListOf111[nodeListOf11.length + 4].innerText;
            //物料编号
            let productId = nodeListOf111[nodeListOf11.length - 1].innerText;
            //物料名称
            let productName = nodeListOf111[nodeListOf11.length - 2].innerText;
            //序号
            let innerText8 = nodeListOf111[nodeListOf11.length - 3].innerText;
            console.log(innerText8)
            var zzz = {
                detailsInt:innerText8,
                parentId: procedureId,
                productId: productId,
                productName: productName,
                type: "Y001-2",
                amount: amount,
                amountUnit: amountUnit,
                costPrice: costPrice,
                subtotal: subtotal,
            }
            $.ajax({
                type: "post",
                dataType: "json",
                data: JSON.stringify(zzz),
                contentType: "application/json",
                url: "/cha/addw/",
                success: function (data) {
                    console.log("yeye")
                }
            })
        }

     }
     function tuichu() {
            document.getElementById("div3").style.display='none'
         document.getElementById("div2").style.display='block'
         document.getElementById("div1").style.display='none'
     }
     function tijiao11() {
        // console.log("zzzzzz")
        // let nodeListOf22 = document.getElementById("tableOnlineEdit").querySelectorAll("tr");
        // for (var j=0;j<nodeListOf22.length-1;j++) {
        //     var nodeListOf1111 = nodeListOf22[j + 1].querySelectorAll("td");
        //
        // }
         let procedureId = document.getElementById("cpbh").innerText;
         $.ajax({
             type:"post",
             url:"/cha/upz/"+procedureId,
             dataType:"json",
             success:function (data) {
                 console.log("zzxc")
                 document.getElementById("div2").style.display='none'
                 document.getElementById("div3").style.display='none'
                 document.getElementById("div1").style.display='block'
                 $("#table").bootstrapTable("refresh");
             }
         })
     }
</script>
</body>
</html>
